The generation of a document on a data processing system, such as by means of a "tag" language, for example, a generalized markup language, such as HTML (Hypertext Markup Language), or a LATEX document, is enhanced by embedding dynamic data fetched from a data store. The dynamic data allows the document to be dynamic and provide up to date information.
Dynamic data is data that is updated and the updates stored for access in the same data store. One example is stock prices, which may be updated continuously or on a periodic basis.
To fetch data, usually a scripting language is used, such as Net.Data, Visual Basic, or Perl script. Using these script languages along with embedded SQL elements, one can fetch data, and format the data accordingly.
If the document embeds the dynamic data, the data should be fetched whenever the document is referenced, such as whenever it is sent over a network, or whenever it is printed.
Visual tools have been developed for creating a document in the various tag languages, and some visual tools have been developed for fetching data. For example, visual HTML editors are used to write HTML documents, and visual tools to view a latex document. Visual tools are available to generate SQL statements, or generate a Net.Data script that can fetch data. The above visual tools are often used repeatedly during the document development and maintenance process.
A key difficulty is that no single tool is presently usable to both create a document and to write the script to fetch dynamic data.
Since the desired data is dynamic, it is not possible to manually fetch the data from the data base by executing the data script and manually incorporating the data in the desired place in the document each time the dynamic data changes or is to be displayed.
An approach usable to embed dynamic data in a document written in a tag language, when using visual tools for document and data access script creation, is illustrated in FIG. 1.
A visual tool 10 is used to produce a document 11 in a tag language. Examples of visual tools include NetObjects Fusion (by NetObjects, Inc.) or HotMetaL (by SoftQuad, Inc.), which are commercially available and can be used by a user to manually produce a document in HTML. If the user is not totally satisfied with the document 11, the user will make changes 12, using the visual tool 10 again. Examples of changes are the color, font, font size, and the user may want to add to or edit the content. Ultimately, the document 11 is produced, but does not include the desired dynamic data. Rather, it may have an identifier for each instance of dynamic data, or the user will have to remember where each instance of the desired dynamic data is to be placed.
A simplified example of an HTML document page may be:
&lt;HTML&gt; PA1 &lt;P&gt; PA1 &lt;P&gt; PA1 &lt;/HTML&gt; PA1 identifying, in the preliminary markup document file, the matching pair of the special beginning tag and the ending tag, thereby identifying the delimited area therebetween; PA1 selecting the predefined script file; PA1 generating a linked document file by adding, at the identified area in the preliminary markup document file, the linkage identifier for the selected predefined script file; and PA1 generating a final script file merging the predefined script file having the dynamic data fetch command with the linked document file.
&lt;TITLE&gt;IBM Stock Report&lt;/TITLE&gt;
The current stock price for IBM is XXX
A different type of visual tool 15 is employed by the user to produce a script file to access desired data. An example is a visual tool which generates Net.Data scripts. The tool 15 will show the available data bases, and the user will select the desired data base. Then, the tool 15 will show tables of the selected data base, and the user will select the desired table. Next, the tool 15 will show the columns of the selected table and the data of each column, so that the user may select the desired column and dynamic data. Upon selecting the desired data and giving it a criteria or identifier, the tool 15 produces a data script file 16. Other commercially available tools can also allow the user to generate SQL (Structured Query Language) statements for fetching data.
An example of a Net.Data script macro file may be:
______________________________________ % define DATABASE = "stock" % SQL(sql1) { select price from quota where company = 'IBM' %SQL.sub.-- REPORT { %ROW { $(V1) %} %} %} %HTML.sub.-- REPORT { %exec.sub.-- sql (sql1) %} ______________________________________
The above term "% exec.sub.-- sq1(sq11)" is an exemplary Net.data function call which, when executed by Net.data, will execute the SQL statement and put the result into a variable.
When the script file is executed by Net.Data, it will fetch the current IBM stock price for the database.
The user may also decide to make modifications or changes 17 to the script file 16 by again using the tool 15, or, more likely, will want to add additional accesses to other dynamic data as described above.
It is likely that the user will want many instances of dynamic data in the final document, with the result that the last document 11 will have many identifiers (or the user may have an extensive side listing) of intended dynamic data insert points, and that there will be a corresponding number of data script dynamic data accesses in data script file 16 (see FIG. 1).
The difficult project is to merge the data script file 16 and the document 11. Another difficult project is to later modify the document 11.
The merging of the data script file 16 and the document 11 in the prior art is illustrated by step 20. A way of manually conducting the merging of the data script file 16 and the document 11 is to cut and paste parts of document 11 into the data script file 16. This is a very tedious step because every element of document 11 must separately be placed into the data script file 16 and the dynamic data accesses of data script file 16 must be located at the appropriate points in the document as desired by the user.
The data script file program (e.g., Net.Data) is then run to produce the final document 21.
The incorporation of both the HTML file and the Net.Data script file into the final Net.Data script file appears as:
______________________________________ %define DATABASE = "stock" %SQL(sql1) { select price from quota where company = 'IBM' %SQL.sub.-- REPORT { %ROW { $(V1) %} %} %} %HTML.sub.-- REPORT { &lt;HTML&gt; &lt;TITLE&gt;IBM Stock Report&lt;/TITLE&gt; &lt;P &gt; The current stock price for IBM is % exec.sub.-- sql(sql1) &lt;P &gt; &lt;/HTML&gt; %} ______________________________________
If the user wishes to change or modify the document 21 at this stage, such as to change color, there is no way to do so, since the visual tool 10 is not available to the user at this stage. Rather, the user must go back to visual tool 10, make the change to document 11, and create the final document 21 again in step 20. Since this step 20 essentially repeats the incorporation work, it can be very tedious.
The key difficulty, again, is that no single tool is presently usable to both create a document and to write the script to fetch dynamic data. Therefore, two tools 10 and 15 must be used separately to produce a separate document and script, and the tedious manual step 20 employed to merge the two. Executing the final script will produce the final document 21.
Each time the user wishes to change the document, tool 10 must be used with document 11 as the basis for the change. The tedious manual merge step 20 must then be repeated to generate the changed final script.